Skip to content

feat(catalog-etl): account for full runEtl() runs in scheduler skip guard#292

Open
GitAddRemote wants to merge 1 commit into
feature/ISSUE-227from
feature/ISSUE-228
Open

feat(catalog-etl): account for full runEtl() runs in scheduler skip guard#292
GitAddRemote wants to merge 1 commit into
feature/ISSUE-227from
feature/ISSUE-228

Conversation

@GitAddRemote
Copy link
Copy Markdown
Owner

Summary

  • getLastSuccessfulStepRun() previously filtered WHERE r.step_name = $1, which only matched runStep() invocations — full runEtl() rows have step_name = NULL and were never considered
  • The WHERE clause is now (r.step_name = $1 OR r.step_name IS NULL), so a clean full-ETL completion within 12h correctly triggers the skip guard for terminals-sync and terminal-distances-sync
  • The existing steps_failed = 0 and NOT EXISTS (severity='error' warning) guards remain, ensuring partial or failed full runs don't suppress individual step reruns

Note: This PR targets feature/ISSUE-227 (not main) since it stacks on top of the skip-guard safety wrapper introduced there.

Test plan

  • New test: returns null when no completed run exists
  • New test: returns completed_at from a step-name-matched run
  • New test: SQL contains r.step_name IS NULL (verifies the query was actually updated)
  • All 15 catalog-etl.service.spec.ts tests pass
  • ESLint and Prettier clean

Closes #228

- Extend getLastSuccessfulStepRun() WHERE clause to also match step_name IS NULL rows (full runEtl() runs) in addition to per-step runStep() rows; steps_failed = 0 and no error warning condition already ensures all steps succeeded in a full run
- Add 3 tests: null result, step-name match, and query contains 'r.step_name IS NULL'

Closes #228
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant